package Book;

/**
 * Created with IntelliJ IDEA.
 * Description: 书架
 * User: 洪汤泽大帅哥
 * Date: 2024-11-01
 * Time: 20:06
 */
public class BookList {
    private Book[] books;
    private static final int DEFAULT_SIZE = 10;

    private int usedSize;//有效书籍个数

    public BookList(){
        this.books = new Book[DEFAULT_SIZE];
        this.books[0] = new Book("三国演义","罗贯中",19,"武侠");
        this.books[1] = new Book("西游记","吴承恩",15,"神话");
        this.books[2] = new Book("红楼梦","曹雪芹",10,"小说");
        this.usedSize=3;
    }

    public int getUsedSize() {
        return usedSize;
    }
    public Book[] getBooks(){
        return books;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
    //还有待补充的

    public Book getBooks(int pos) {
        return books[pos];
    }
    public void setBooks(int pos ,Book book){
        books[pos]=book;
    }

}
